package site.lanmushan.framework.mapper.params;

import net.sf.jsqlparser.expression.BinaryExpression;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.ExpressionVisitor;

import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Administrator
 */
public class SlashOrExpression  extends SlashExpression{

    @Override
    public String toString() {
        List<String> result= expressions.stream().map(it->it.toString()).collect(Collectors.toList());
        if(result.isEmpty())
        {
            return "";
        }
        return "("+String.join(" or ",result)+")";
    }

    @Override
    public String getStringExpression() {
        return "or";
    }


    @Override
    public void accept(ExpressionVisitor expressionVisitor) {

    }
}
